Performance.registerGroup({
	name: "js.create"
});

Performance.registerTest({
	group: "js.create",
	name: "create: integer",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var arr = [];
		for(var i = 0; i < arg; i++) {
			arr.push(i);
		}
	}
});

Performance.registerTest({
	group: "js.create",
	name: "create: string",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var arr = [];
		for(var i = 0; i < arg; i++) {
			arr.push("string");
		}
	}
});

Performance.registerTest({
	group: "js.create",
	name: "create: regexp -primitive",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var arr = [];
		for(var i = 0; i < arg; i++) {
			arr.push(/string/);
		}
	}
});

Performance.registerTest({
	group: "js.create",
	name: "create: regexp -object",
	args: [2500, 5000, 10000, 15000],
	
	run: function(arg) {
		var arr = [];
		for(var i = 0; i < arg; i++) {
			arr.push(new RegExp("string"));
		}
	}
});

Performance.registerTest({
	group: "js.create",
	name: "create: regexp -object -complex",
	args: [2500, 5000, 10000, 15000],
	
	run: function(arg) {
		var arr = [];
		for(var i = 0; i < arg; i++) {
			arr.push(new RegExp("^menu\.items\.[a-zA-Z0-9_]+"));
		}
	}
});



Performance.registerTest({
	group: "js.create",
	name: "create: function",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var arr = [];
		for(var i = 0; i < arg; i++) {
			arr.push(function() { return i; });
		}
	}
});

Performance.registerTest({
	group: "js.create",
	name: "create: object",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var arr = [];
		for(var i = 0; i < arg; i++) {
			arr.push({i:i});
		}
	}
});

Performance.registerTest({
	group: "js.create",
	name: "create: object -complex",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var arr = [];
		for(var i = 0; i < arg; i++) {
			arr.push({a: "a", b: "b", c: "c", d: "d", e: "e", int: i, float: 1.2});
		}
	}
});

Performance.registerTest({
	group: "js.create",
	name: "create: array",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var arr = [];
		for(var i = 0; i < arg; i++) {
			arr.push([]);
		}
	}
});

Performance.registerTest({
	group: "js.create",
	name: "create: array -complex",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var arr = [];
		for(var i = 0; i < arg; i++) {
			arr.push(["a", "b", "c", "d", "e", i, 1.2]);
		}
	}
});

Performance.registerTest({
	group: "js.create",
	name: "create: class -by-prototype",
	args: [25000, 50000, 100000],
	
	run: function(arg) {
		var proto = {x: 21, y:12};
			arr = [];
		for(var i = 0; i < arg; i++) {
			arr.push(Object.create(proto));
		}
	}
});

Performance.registerTest({
	group: "js.create",
	name: "create: class -yui-by-prototype",
	args: [25000, 50000, 100000],
	
	run: function(arg) {
		var proto = {x: 21, y:12};
			arr = [];
		for(var i = 0; i < arg; i++) {
			arr.push(Object(proto));
		}
	}
});

Performance.registerTest({
	group: "js.create",
	name: "create: class",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var arr = [];
		for(var i = 0; i < arg; i++) {
			arr.push(new Core.Random());
		}
	}
});

Performance.registerTest({
	group: "js.create",
	name: "create: string -object",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var arr = [];
		for(var i = 0; i < arg; i++) {
			arr.push(new String("sasasak"));
		}
	}
});

Performance.registerTest({
	group: "js.create",
	name: "create: number -object",
	args: [25000, 50000, 100000, 150000],
	
	run: function(arg) {
		var arr = [];
		for(var i = 0; i < arg; i++) {
			arr.push(new Number(12));
		}
	}
});